Field of the Invention
The present invention generally relates to multithreaded processing and more specifically to a method and system for resolving thread divergences.
Description of the Related Art
A “thread group” is a set of parallel threads that execute the same instruction together in a single-instruction multiple-thread (SIMT) or single-instruction multiple-data (SIMD) fashion. A parallel processing unit (PPU) may issue and execute many parallel threads simultaneously in order to perform a variety of different processing tasks. When a given thread executes, that thread may read data from or write data to a particular memory location, such as a register file. Typically, the various threads within a thread group all target the same memory location. However, certain types of instructions may cause a branch to occur, causing some threads to target one memory location while causing other threads to target other memory locations. This is known in the art as “thread divergence.” With conventional PPUs, thread divergence may result in system-wide PPU failure.
Accordingly, what is needed in the art is a technique for resolving divergences between threads within a thread group.